//
//  BIDSentNoticeCell.m
//  cxgov
//
//  Created by mal on 16/3/7.
//  Copyright © 2016年 mal. All rights reserved.
//

#import "BIDSentLeaveCell.h"

@implementation BIDSentLeaveCell
@synthesize titleLabel;
@synthesize dateLabel;
@synthesize replyCountLabel;
@synthesize leadingForTitleLabelConstraint;
@synthesize widthForReplyCountLabelConstraint;

- (void)awakeFromNib {
    // Initialization code
    replyCountLabel.clipsToBounds = YES;
    replyCountLabel.layer.cornerRadius = CGRectGetHeight(replyCountLabel.frame)/2;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setReplyCount:(NSInteger)replyCount
{
    replyCountLabel.text = [[NSString alloc] initWithFormat:@"%ld", replyCount];
    if(replyCount == 0)
    {
        //没有未读回复
        leadingForTitleLabelConstraint.constant = 0;
        widthForReplyCountLabelConstraint.constant = 0;
        [self layoutIfNeeded];
    }
    else
    {
        //有未读回复
        leadingForTitleLabelConstraint.constant = 8;
        widthForReplyCountLabelConstraint.constant = 15;
        [self layoutIfNeeded];
    }
}


@end
